<%@ page import="java.io.PrintWriter" %>

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/9/23
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%

    String requestUserName = String.valueOf(request.getAttribute("username"));
    String servletUserName = String.valueOf(request.getServletContext().getAttribute("username"));
    String username = String.valueOf(session.getAttribute("username"));
    String password = String.valueOf(session.getAttribute("password"));

    PrintWriter writer = response.getWriter();
    StringBuilder result =  new StringBuilder();
    result.append("current user:");
    result.append(username).append("\t").append(password).append("\n");


    result.append("requestUserName: \t").append(requestUserName);
    result.append("\n");


    result.append("servletUserName :\t ").append(servletUserName).append("\n");

    writer.print(result);

    writer.flush();
    writer.close();
%>
</body>
</html>
